package progress;

import java.util.Scanner;

/**
 * @author Seon
 * @date 2022/10/28 14:49
 */
public class Client {
    public static void main(String[] args) {
        /*
        式子的英文，formula
        简单工厂模式
         */
        System.out.println("输入例如： [2 + 3] 之类的算式，中间记得用空格隔开。");
        Scanner scanner = new Scanner(System.in);
        String formula = scanner.nextLine();
        String[] split = formula.split(" ");

        Operation operation = OperationFactory.createOperate(split[1]);
        System.out.println(operation.getResult(Double.parseDouble(split[0]), Double.parseDouble(split[2])));
    }
}
